<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
</head>
<body>
<h1>欢迎来到首页</h1>
<p th:text="${messages}">首页</p>
<a th:if="${session.user == null}" th:href="@{/login}">登录</a>
<a th:if="${session.user != null}" th:href="@{/logout}">登出</a>
<a th:text="${session.user}">登出</a>
</body>
</html>